package top.jybill.dao;

import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Repository;
import top.jybill.domain.MyPageInfo;
import top.jybill.domain.MyUser;

import java.util.List;

@Repository
public interface IUserDao {

  /**
   * 查询用户
   * @param user
   * @return
   */
  MyUser findUser(MyUser user);

  /**
   * 根据分页数据查询所有用户
   * @param page
   * @return
   */
  List<MyUser> findUsersByPage(MyPageInfo page);


  /**
   * 添加用户
   * @param user
   */
  void addUser(MyUser user);

  /**
   * 删除用户
   * @param uid
   */
  void delUser(String uid);

  /**
   * 更新用户
   * @param user
   */
  void updateUser(MyUser user);

  /**
   * 根据用户id查询用户
   * @param uid
   * @return
   */
  MyUser findUserByuid(String uid);
}
